package messages;

import java.util.List;
import java.util.StringTokenizer;

import others.Constants;


public class Mess1xx extends Message {
    
    public String typeName;

    public Mess1xx(String number) {
    	
        super(number);
        
        if(number.equals("100")) {
            typeName = "trying";;
        }
        else if(number.equals("101")) {
            typeName = "found";
        }
        else if(number.equals("180")) {
            typeName = "ringing";
        }
    }

    @Override
    public void parseMessage(List<StringTokenizer> tokens) {
        typeName = tokens.get(0).nextToken();
            //log
            System.out.println(messageType + " " + typeName);
    }

    @Override
    public String writeMessage() {
        return (messageType+" " + typeName + Constants.CRLF);
    }

}
